<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new JMS\AopBundle\JMSAopBundle(),
            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
        	new FOS\UserBundle\FOSUserBundle(),
        	new IMT\DashboardBundle\IMTDashboardBundle(),
        	new IMT\EventBundle\IMTEventBundle(),
        	//new IMT\Utilisateurs\UtilisateurBundle\IMTUtilisateursUtilisateurBundle(),
        	new IMT\UserBundle\IMTUserBundle(),
        	new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
        	new IMT\NotificationBundle\IMTNotificationBundle(),
        	new IMT\AccountBundle\IMTAccountBundle(),
        	//new BeSimple\SoapBundle\BeSimpleSoapBundle(),
        	new IMT\ServicesBundle\IMTServicesBundle(),
        	new IMT\Plugins\GeneralBundle\IMTPluginsGeneralBundle(),
        	new IMT\PluginBundle\IMTPluginBundle(),
        	new IMT\Plugins\ParticipantsBundle\IMTPluginsParticipantsBundle(),
        	new IMT\Plugins\GeneralTaskBundle\IMTPluginsGeneralTaskBundle(),
        	new IMT\Plugins\AttachmentsBundle\IMTPluginsAttachmentsBundle(),
        	new IMT\Plugins\GeneralCallBundle\IMTPluginsGeneralCallBundle(),
        	new JMS\SerializerBundle\JMSSerializerBundle($this),
        	new FOS\RestBundle\FOSRestBundle(),
        	new FOS\CommentBundle\FOSCommentBundle(),
        	new IMT\CommentBundle\IMTCommentBundle(),
        	new IMT\Plugins\CommentsBundle\IMTPluginsCommentsBundle(),
        	new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
        	new Vich\UploaderBundle\VichUploaderBundle(),
        	new IMT\AttachmentsBundle\IMTAttachmentsBundle(),
        	new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
        	new IMT\OAuthServerBundle\IMTOAuthServerBundle(),
            new IMT\ReportingBundle\IMTReportingBundle(),
        	new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
            new IMT\Plugins\GeneralMeetingBundle\IMTPluginsGeneralMeetingBundle(),
            new IMT\Plugins\TwitterBundle\IMTPluginsTwitterBundle(),
            new IMT\Plugins\MapsBundle\IMTPluginsMapsBundle(),
            new IMT\Plugins\NoteBundle\IMTPluginsNoteBundle(),
            new IMT\Plugins\OrderBundle\IMTPluginsOrderBundle(),
            new IMT\SynchBundle\IMTSynchBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            //$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}
